<template>
  <div class="navbar">
    <!-- :router 开启路由功能,则 index指定路由地址
default-active 默认选中哪个菜单,选中为黄色,
注意 v-bind:default-active 才可以指定表达式 -->
    <el-menu
      :router="true"
      :default-active="$route.path"
      class="el-menu-vertical-demo"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <el-menu-item index="/home">
        <i class="el-icon-s-home"></i>
        <span slot="title">首页</span>
      </el-menu-item>
      <el-menu-item index="/user/">
        <i class="el-icon-user-solid"></i>
        <span slot="title">用户管理</span>
      </el-menu-item>
      <el-menu-item index="/menu01/">
        <i class="el-icon-menu"></i>
        <span slot="title">功能菜单一</span>
      </el-menu-item>
      <el-menu-item index="/menu02/">
        <i class="el-icon-menu"></i>
        <span slot="title">功能菜单二</span>
      </el-menu-item>
      <el-menu-item index="/menu03/">
        <i class="el-icon-menu"></i>
        <span slot="title">功能菜单三</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>
<style scoped>
.el-menu {
  border-right: none;
}
/* 选择菜单的颜色 */
.is-active {
  color: #31c17b !important;
}
</style>
